package com.ctgu.蓝桥杯真题.B组2018;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

/**
 * @author: Backdiy
 * @data: 2021/4/12 14:53
 * @desc:
 */
public class A第几天 {
    static int[] mon = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    static String base = "2000-1-1";

    public static void main(String[] args) throws ParseException {
        Scanner scanner = new Scanner(System.in);
        int y = scanner.nextInt(), m = scanner.nextInt(), d = scanner.nextInt();
        check(y);
        System.out.println(myDays(y, m, d));
        System.out.println(SyDays(y, m, d));
    }

    private static long SyDays(int y, int m, int d) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date parse = simpleDateFormat.parse(base);
        Date parse1 = simpleDateFormat.parse("" + y + "-" + m + "-" + d);
        return ((parse1.getTime()-parse.getTime())/(3600*24*1000))+1;
    }

    private static int myDays(int y, int m, int d) {
        for (int i = 1; i < m; i++) {
            d += mon[i];
        }
        return d;
    }

    private static void check(int y) {
        mon[2] += (y % 4 == 0 && y % 100 != 0 || y % 400 == 0) ? 1 : 0;
    }
}
